home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol E-12 / (Vol E-12) May 21 2012.iso / Animations / dj / dj.swf / scripts / __Packages / mx / screens / Screen.as
Text File  |  2012-05-21  |  4KB  |  171 lines

  1. class mx.screens.Screen extends mx.controls.Loader
  2. {
  3.    static var symbolName = "Screen";
  4.    static var symbolOwner = mx.screens.Screen;
  5.    var className = "Screen";
  6.    var _isScreen = true;
  7.    var _indexInParent = 0;
  8.    var __transitionManager = null;
  9.    var _childLoading = "";
  10.    var borderStyle = "none";
  11.    function Screen()
  12.    {
  13.       super();
  14.    }
  15.    function get indexInParent()
  16.    {
  17.       return this._indexInParent;
  18.    }
  19.    function get numChildScreens()
  20.    {
  21.       return this._childScreens.length;
  22.    }
  23.    function get parentIsScreen()
  24.    {
  25.       var _loc2_ = this.__get__parentScreen() != null && this.parentScreen._isScreen;
  26.       return _loc2_;
  27.    }
  28.    function get parentScreen()
  29.    {
  30.       var _loc2_ = this._parent;
  31.       if(_loc2_ == null)
  32.       {
  33.          return null;
  34.       }
  35.       if(_loc2_._isScreen)
  36.       {
  37.          return _loc2_;
  38.       }
  39.       return null;
  40.    }
  41.    function get rootScreen()
  42.    {
  43.       var _loc2_ = this;
  44.       while(_loc2_.__get__parentIsScreen())
  45.       {
  46.          _loc2_ = _loc2_.parentScreen;
  47.       }
  48.       return _loc2_;
  49.    }
  50.    function get transitionManager()
  51.    {
  52.       return this.__transitionManager;
  53.    }
  54.    static function get currentFocusedScreen()
  55.    {
  56.       var curFocus;
  57.       curFocus = _root.focusManager.getFocus();
  58.       if(!curFocus || curFocus == undefined)
  59.       {
  60.          curFocus = eval(Selection.getFocus());
  61.       }
  62.       while(curFocus && !curFocus._isScreen)
  63.       {
  64.          curFocus = curFocus._parent;
  65.       }
  66.       if(curFocus == undefined)
  67.       {
  68.          return null;
  69.       }
  70.       return curFocus;
  71.    }
  72.    function getChildScreen(childIndex)
  73.    {
  74.       return this._childScreens[childIndex];
  75.    }
  76.    function createChild(className, instanceName, initProps)
  77.    {
  78.       var _loc4_ = undefined;
  79.       this._childLoading = instanceName;
  80.       return super.createChild(className,instanceName,initProps);
  81.    }
  82.    function drawFocus()
  83.    {
  84.    }
  85.    function init()
  86.    {
  87.       mx.core.ext.UIObjectExtensions.Extensions();
  88.       mx.core.ext.UIComponentExtensions.Extensions();
  89.       mx.events.LowLevelEvents.enableLowLevelEvents();
  90.       this._childScreens = [];
  91.       super.init();
  92.       this._loadExternalClass = mx.screens.Screen.symbolName;
  93.       this.__set__scaleContent(false);
  94.       mx.events.UIEventDispatcher.initialize(this);
  95.       if(this._parent._childLoading != this._name)
  96.       {
  97.          if(this.__get__parentIsScreen())
  98.          {
  99.             this._parent.registerChildScreen(this);
  100.          }
  101.       }
  102.    }
  103.    function registerChildScreen(scrn)
  104.    {
  105.       scrn._indexInParent = this._childScreens.push(scrn) - 1;
  106.    }
  107.    function childLoaded(obj)
  108.    {
  109.       super.childLoaded(obj);
  110.       var _loc4_ = undefined;
  111.       var _loc5_ = null;
  112.       var _loc7_ = obj._parent;
  113.       for(_loc4_ in obj)
  114.       {
  115.          if(typeof obj[_loc4_] == "movieclip" && obj[_loc4_]._isScreen)
  116.          {
  117.             _loc5_ = obj[_loc4_];
  118.             break;
  119.          }
  120.       }
  121.       if(_loc5_._isScreen)
  122.       {
  123.          if(!this.__get__scaleContent())
  124.          {
  125.             var _loc6_ = new Object();
  126.             _loc6_.x = obj.x;
  127.             _loc6_.y = obj.y;
  128.             this.globalToLocal(_loc6_);
  129.             obj._x = _loc6_.x;
  130.             obj._y = _loc6_.y;
  131.          }
  132.          else
  133.          {
  134.             _loc6_ = new Object();
  135.             _loc6_.x = this.x;
  136.             _loc6_.y = this.y;
  137.             this._parent.localToGlobal(_loc6_);
  138.             obj.globalToLocal(_loc6_);
  139.             _loc5_._x = _loc6_.x;
  140.             _loc5_._y = _loc6_.y;
  141.          }
  142.          _loc5_._indexInParent = _loc7_._childScreens.push(_loc5_) - 1;
  143.          obj._isScreenContainer = true;
  144.          obj._containedScreen = _loc5_;
  145.       }
  146.       _loc7_._childLoading = "";
  147.    }
  148.    function doScaleLoader()
  149.    {
  150.    }
  151.    function createChildren()
  152.    {
  153.       this.border_mc = new mx.skins.RectBorder();
  154.       this.border_mc.__borderMetrics = {top:0,left:0,bottom:0,right:0};
  155.       super.createChildren();
  156.    }
  157.    function allTransitionsInDone()
  158.    {
  159.       this.dispatchEvent({type:"allTransitionsInDone",target:this});
  160.    }
  161.    function allTransitionsOutDone()
  162.    {
  163.       this.dispatchEvent({type:"allTransitionsOutDone",target:this});
  164.    }
  165.    function destroyChildAt(childIndex)
  166.    {
  167.       this._childScreens.splice(childIndex,1);
  168.       super.destroyChildAt(childIndex);
  169.    }
  170. }
  171.